package com.liuxia8.part8.stacks;

import java.time.LocalDateTime;
import java.util.Stack;

/**
 * Created by weng.junjie on 2017/2/24.
 */
public class Stacks {
    static String[] months = {"January", "February", "March", "April", "May",
            "June", "July", "August", "September", "October", "November", "December"};

    public static void main(String[] args) {
        Stack stack = new Stack();
        for (int i = 0; i < months.length; i++) {
            stack.push(months[i]);
        }
        System.out.println("stk===" + stack);
        stack.push("the last line");
        System.out.println("element 5="+stack.elementAt(5));


        System.out.println("search："+stack.search("December"));
        System.out.println("pop element：：");
        while(!stack.empty()){
            System.out.println(stack.pop());
        }
    }
}
